function getFileExtension(filename) {
  if (filename.includes(".")) {
    return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2)
  } else {
    return 'image';
  }
}
function getFileType(filename) {
  const videoFileType = ['mp4', 'mov', 'm4v', '3gp', 'avi', 'm3u8', 'webm'];
  const fileExtension = getFileExtension(filename);
  if (videoFileType.includes(fileExtension)) {
    return 'video';
  }
  return 'image';
}
module.exports = {
  getFileExtension,
  getFileType,
}